<include file="Public:header" />
<include file="Public:menu" />

<div  id="main_content_wrap" class="container_12">
  <div class="container_12 boxbody">
  <h2>
    编辑管理员信息
  </h2>
  <form action="{:U('Index/done')}" method="post" id="checkAdminForm"  name="myform" enctype="multipart/form-data">
    <p>
      <label>用户名：</label>
      <input value="{$thisname}" name="adminname" readonly class="text small" placeholder="只能输入英文字母和数字" onkeyup="value=value.replace(/[^\w\.\/]/ig,'')">
    </p>
    <p>
      <label>手机号：</label>
      <input type="number" value="{$thisphone}" name="phone" placeholder="请输入11位手机号码" class="text small" />

    </p>
    <p>
      <label>密&nbsp;&nbsp;&nbsp;码：</label>
      <input type="password" value="" name="password" class="text small" placeholder="只能输入英文字母和数字" >
    </p>
    <p>
      <label>确认密码：</label>
      <input type="password" value="" name="password1" class="text small" placeholder="再次输入密码">
    </p>

    <p class='tac'>
      <input type="hidden" name="super" value="0" />
      <input type="hidden" name="uid" value="{$uid}" />
      <input type="button" class="submit" value="保存" onclick="checkthis_add()" />
    </p>
    </form>
    </div>
</div>
<script>
  function checkthis_add() {
    var adminname = document.myform.adminname.value;
    var phone = document.myform.phone.value;
    var password = document.myform.password.value;
    var password1 = document.myform.password1.value;
    if (adminname == '') {
      alert('请填写用户名')
    }
    else if (phone.length >0 && phone.length != 11) {
      alert('请填写正确的手机号');
    }
    else if (password.length < 6) {
      alert('密码不能少于6位');
    }else if (password != password1) {
      alert('两次输入密码不一致');
    }

    else {
      document.myform.submit();//button按钮实现提交 方法
    }

  }
</script>
<include file="Public:footer" />